//
//  KKLiveMessageCells.m
//  KKLiveDemo
//
//  Created by leo on 2017/7/30.
//  Copyright © 2017年 leo. All rights reserved.
//

#import "KKLiveMessageCells.h"

#pragma mark - KKLiveTextMessageCell methods
@implementation KKLiveTextMessageCell

//  加入内容控件
- (UIView*)addElemContent {
    _lab_messageText = [[UILabel alloc] init];
    return _lab_messageText;
}

- (void)configContent {
    [super configContent];
    _lab_messageText.text = self.msg.msg;
}

- (void)configWithMsg:(KKMessageItem *)msg {
    [super configWithMsg: msg];
}

@end

#pragma mark - KKLiveAudioMessageCell methods
@implementation KKLiveAudioMessageCell

- (UIView*)addElemContent {
    
    UIView *contentView = [[UIView alloc] init];
    {
        _lab_messageTime = [[UILabel alloc] init];
        [contentView addSubview: _lab_messageTime];
        
        _chatImage = [[UIImageView alloc] init];
        [contentView addSubview: _chatImage];
    }
    return contentView;
}

@end

#pragma mark - KKLivePictureMessageCell methods
@implementation KKLivePictureMessageCell

- (UIView*)addElemContent {
    _img_messageImage = [[UIImageView alloc] init];
    return _img_messageImage;
}

@end

#pragma mark - KKLiveEmoticonMessageCell methods
@implementation KKLiveEmoticonMessageCell
- (UIView*)addElemContent {
    _img_messageImage = [[UIImageView alloc] init];
    return _img_messageImage;
}
@end


#pragma mark - KKLiveTimeTipsMessageCell methods
@implementation KKLiveTimeTipsMessageCell

- (instancetype)initWithC2CReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle: UITableViewCellStyleDefault reuseIdentifier: reuseIdentifier];
    if (self) {
        [self private_initMessageCell];
    }
    return self;
}

- (instancetype)initWithGroupReuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle: UITableViewCellStyleDefault reuseIdentifier: reuseIdentifier];
    if (self) {
        [self private_initMessageCell];
    }
    return self;
}

- (void)configWithMsg:(KKMessageItem *)msg {
    [super configWithMsg: msg];
    
    self.textLabel.text = @"dsfdsfdsfdsfsd";
}

#pragma mark - Private methods
- (void)private_initMessageCell {
    self.contentView.backgroundColor = [UIColor clearColor];
    self.backgroundColor = [UIColor clearColor];
    self.textLabel.textAlignment = NSTextAlignmentCenter;
    self.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
    self.textLabel.numberOfLines = 0;
    self.textLabel.font = [UIFont systemFontOfSize:12];
    self.textLabel.textColor = [UIColor lightGrayColor];
}

@end
